#coding=utf-8
#Boa:Dialog:DlgPrivileges

import wx

from product import *
import config
from ctrlAider import MyComboBoxDecorator

def create(parent):
    return DlgPrivileges(parent)

[wxID_DLGPRIVILEGES, wxID_DLGPRIVILEGESBTNCHECKALL, 
 wxID_DLGPRIVILEGESBTNNEWGROUP, wxID_DLGPRIVILEGESCBACCOUNT, 
 wxID_DLGPRIVILEGESCBANTIAUDITDELIVERY, wxID_DLGPRIVILEGESCBANTIAUDITPEERLEND, 
 wxID_DLGPRIVILEGESCBANTIAUDITPUR, wxID_DLGPRIVILEGESCBANTIAUDITSALE, 
 wxID_DLGPRIVILEGESCBANTIAUDITVOUCHER, wxID_DLGPRIVILEGESCBAUDITDELIVERY, 
 wxID_DLGPRIVILEGESCBAUDITPEERLEND, wxID_DLGPRIVILEGESCBAUDITPUR, 
 wxID_DLGPRIVILEGESCBAUDITSALE, wxID_DLGPRIVILEGESCBAUDITVOUCHER, 
 wxID_DLGPRIVILEGESCBCREATECUSTOMER, wxID_DLGPRIVILEGESCBCREATEDELIVERY, 
 wxID_DLGPRIVILEGESCBCREATEPEER, wxID_DLGPRIVILEGESCBCREATEPEERLEND, 
 wxID_DLGPRIVILEGESCBCREATEPRODUCT, wxID_DLGPRIVILEGESCBCREATEPUR, 
 wxID_DLGPRIVILEGESCBCREATESALE, wxID_DLGPRIVILEGESCBCREATESUPPLIER, 
 wxID_DLGPRIVILEGESCBCREATEVOUCHER, wxID_DLGPRIVILEGESCBDELCUSTOMER, 
 wxID_DLGPRIVILEGESCBDELDELIVERY, wxID_DLGPRIVILEGESCBDELPEER, 
 wxID_DLGPRIVILEGESCBDELPEERLEND, wxID_DLGPRIVILEGESCBDELPRODUCT, 
 wxID_DLGPRIVILEGESCBDELPUR, wxID_DLGPRIVILEGESCBDELSALE, 
 wxID_DLGPRIVILEGESCBDELSUPPLIER, wxID_DLGPRIVILEGESCBDELVOUCHER, 
 wxID_DLGPRIVILEGESCBEDITCUSTOMER, wxID_DLGPRIVILEGESCBEDITDELIVERY, 
 wxID_DLGPRIVILEGESCBEDITOTHERDELIVERY, wxID_DLGPRIVILEGESCBEDITOTHERPEERLEND, 
 wxID_DLGPRIVILEGESCBEDITOTHERPUR, wxID_DLGPRIVILEGESCBEDITOTHERSALE, 
 wxID_DLGPRIVILEGESCBEDITOTHERVOUCHER, wxID_DLGPRIVILEGESCBEDITPEER, 
 wxID_DLGPRIVILEGESCBEDITPEERLEND, wxID_DLGPRIVILEGESCBEDITPRODUCT, 
 wxID_DLGPRIVILEGESCBEDITPUR, wxID_DLGPRIVILEGESCBEDITSALE, 
 wxID_DLGPRIVILEGESCBEDITSUPPLIER, wxID_DLGPRIVILEGESCBEDITVOUCHER, 
 wxID_DLGPRIVILEGESCBEXPENSE, wxID_DLGPRIVILEGESCBGROUP, 
 wxID_DLGPRIVILEGESCBPRIVILEGE, wxID_DLGPRIVILEGESCBREPORT, 
 wxID_DLGPRIVILEGESCBSETTING, wxID_DLGPRIVILEGESCBSTAFF, 
 wxID_DLGPRIVILEGESSTATICBOX1, wxID_DLGPRIVILEGESSTATICBOX2, 
 wxID_DLGPRIVILEGESSTATICBOX3, wxID_DLGPRIVILEGESSTATICBOX4, 
 wxID_DLGPRIVILEGESSTATICBOX5, wxID_DLGPRIVILEGESSTATICBOX6, 
 wxID_DLGPRIVILEGESSTATICBOX7, wxID_DLGPRIVILEGESSTATICTEXT1, 
] = [wx.NewId() for _init_ctrls in range(60)]

class DlgPrivileges(wx.Dialog):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_DLGPRIVILEGES, name=u'DlgPrivileges',
              parent=prnt, pos=wx.Point(347, 120), size=wx.Size(933, 649),
              style=wx.DEFAULT_DIALOG_STYLE, title=u'\u6743\u9650\u8bbe\u7f6e')
        self.SetClientSize(wx.Size(925, 615))
        self.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              u'\u6977\u4f53_GB2312'))
        self.SetBackgroundColour(wx.Colour(183, 209, 173))
        self.Center(wx.BOTH)

        self.staticText1 = wx.StaticText(id=wxID_DLGPRIVILEGESSTATICTEXT1,
              label=u'\u5458\u5de5\u7ec4\uff1a', name='staticText1',
              parent=self, pos=wx.Point(32, 32), size=wx.Size(68, 16), style=0)

        self.cbGroup = wx.ComboBox(choices=[], id=wxID_DLGPRIVILEGESCBGROUP,
              name=u'cbGroup', parent=self, pos=wx.Point(112, 24),
              size=wx.Size(184, 24), style=wx.CB_READONLY, value=u'')
        self.cbGroup.SetLabel(u'')
        self.cbGroup.Bind(wx.EVT_COMBOBOX, self.OnCbGroupCombobox,
              id=wxID_DLGPRIVILEGESCBGROUP)

        self.staticBox1 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX1,
              label=u'\u91c7\u8d2d\u6743\u9650', name='staticBox1', parent=self,
              pos=wx.Point(24, 144), size=wx.Size(864, 56), style=0)

        self.cbCreatePur = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATEPUR,
              label=u'\u521b\u5efa\u91c7\u8d2d\u5355', name=u'cbCreatePur',
              parent=self, pos=wx.Point(48, 176), size=wx.Size(105, 16),
              style=0)
        self.cbCreatePur.SetValue(True)

        self.cbEditPur = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITPUR,
              label=u'\u7f16\u8f91\u91c7\u8d2d\u5355', name=u'cbEditPur',
              parent=self, pos=wx.Point(176, 176), size=wx.Size(105, 16),
              style=0)
        self.cbEditPur.SetValue(True)

        self.cbEditOtherPur = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITOTHERPUR,
              label=u'\u7f16\u8f91\u4ed6\u4eba\u91c7\u8d2d\u5355',
              name=u'cbEditOtherPur', parent=self, pos=wx.Point(304, 176),
              size=wx.Size(144, 16), style=0)
        self.cbEditOtherPur.SetValue(False)

        self.cbDelPur = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELPUR,
              label=u'\u5220\u9664\u91c7\u8d2d\u5355', name=u'cbDelPur',
              parent=self, pos=wx.Point(472, 176), size=wx.Size(105, 16),
              style=0)
        self.cbDelPur.SetValue(True)

        self.cbAuditPur = wx.CheckBox(id=wxID_DLGPRIVILEGESCBAUDITPUR,
              label=u'\u5ba1\u6838\u91c7\u8d2d\u5355', name=u'cbAuditPur',
              parent=self, pos=wx.Point(608, 176), size=wx.Size(105, 16),
              style=0)
        self.cbAuditPur.SetValue(True)

        self.cbAntiAuditPur = wx.CheckBox(id=wxID_DLGPRIVILEGESCBANTIAUDITPUR,
              label=u'\u53cd\u5ba1\u6838\u91c7\u8d2d\u5355',
              name=u'cbAntiAuditPur', parent=self, pos=wx.Point(744, 176),
              size=wx.Size(120, 16), style=0)
        self.cbAntiAuditPur.SetValue(True)

        self.staticBox2 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX2,
              label=u'\u9500\u552e\u6743\u9650', name='staticBox2', parent=self,
              pos=wx.Point(24, 80), size=wx.Size(864, 56), style=0)

        self.cbCreateSale = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATESALE,
              label=u'\u521b\u5efa\u9500\u552e\u5355', name=u'cbCreateSale',
              parent=self, pos=wx.Point(48, 112), size=wx.Size(105, 16),
              style=0)
        self.cbCreateSale.SetValue(True)
        self.cbCreateSale.Bind(wx.EVT_CHECKBOX, self.OnCbCreateSaleCheckbox,
              id=wxID_DLGPRIVILEGESCBCREATESALE)

        self.cbEditSale = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITSALE,
              label=u'\u7f16\u8f91\u9500\u552e\u5355', name=u'cbEditSale',
              parent=self, pos=wx.Point(176, 112), size=wx.Size(105, 16),
              style=0)
        self.cbEditSale.SetValue(False)

        self.staticBox2 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX2,
              label=u'\u9500\u552e\u6743\u9650', name='staticBox2', parent=self,
              pos=wx.Point(24, 80), size=wx.Size(864, 56), style=0)

        self.cbEditOtherSale = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITOTHERSALE,
              label=u'\u7f16\u8f91\u4ed6\u4eba\u9500\u552e\u5355',
              name=u'cbEditOtherSale', parent=self, pos=wx.Point(304, 112),
              size=wx.Size(144, 16), style=0)
        self.cbEditOtherSale.SetValue(True)

        self.cbDelSale = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELSALE,
              label=u'\u5220\u9664\u9500\u552e\u5355', name=u'cbDelSale',
              parent=self, pos=wx.Point(472, 112), size=wx.Size(105, 16),
              style=0)
        self.cbDelSale.SetValue(True)

        self.cbAuditSale = wx.CheckBox(id=wxID_DLGPRIVILEGESCBAUDITSALE,
              label=u'\u5ba1\u6838\u9500\u552e\u5355', name=u'cbAuditSale',
              parent=self, pos=wx.Point(608, 112), size=wx.Size(105, 16),
              style=0)
        self.cbAuditSale.SetValue(True)

        self.cbAntiAuditSale = wx.CheckBox(id=wxID_DLGPRIVILEGESCBANTIAUDITSALE,
              label=u'\u53cd\u5ba1\u6838\u9500\u552e\u5355',
              name=u'cbAntiAuditSale', parent=self, pos=wx.Point(744, 112),
              size=wx.Size(120, 16), style=0)
        self.cbAntiAuditSale.SetValue(True)

        self.staticBox3 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX3,
              label=u'\u540c\u884c\u501f\u8c03\u6743\u9650', name='staticBox3',
              parent=self, pos=wx.Point(24, 208), size=wx.Size(864, 56),
              style=0)

        self.cbCreatePeerLend = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATEPEERLEND,
              label=u'\u521b\u5efa\u501f\u8c03\u5355', name=u'cbCreatePeerLend',
              parent=self, pos=wx.Point(48, 240), size=wx.Size(105, 16),
              style=0)
        self.cbCreatePeerLend.SetValue(False)

        self.cbEditPeerLend = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITPEERLEND,
              label=u'\u7f16\u8f91\u501f\u8c03\u5355', name=u'cbEditPeerLend',
              parent=self, pos=wx.Point(176, 240), size=wx.Size(105, 16),
              style=0)
        self.cbEditPeerLend.SetValue(False)

        self.cbEditOtherPeerLend = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITOTHERPEERLEND,
              label=u'\u7f16\u8f91\u4ed6\u4eba\u501f\u8c03\u5355',
              name=u'cbEditOtherPeerLend', parent=self, pos=wx.Point(304, 240),
              size=wx.Size(144, 16), style=0)
        self.cbEditOtherPeerLend.SetValue(True)

        self.cbDelPeerLend = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELPEERLEND,
              label=u'\u5220\u9664\u501f\u8c03\u5355', name=u'cbDelPeerLend',
              parent=self, pos=wx.Point(472, 240), size=wx.Size(105, 16),
              style=0)
        self.cbDelPeerLend.SetValue(False)

        self.cbAuditPeerLend = wx.CheckBox(id=wxID_DLGPRIVILEGESCBAUDITPEERLEND,
              label=u'\u5ba1\u6838\u501f\u8c03\u5355', name=u'cbAuditPeerLend',
              parent=self, pos=wx.Point(608, 240), size=wx.Size(105, 16),
              style=0)
        self.cbAuditPeerLend.SetValue(False)

        self.cbAntiauditPeerLend = wx.CheckBox(id=wxID_DLGPRIVILEGESCBANTIAUDITPEERLEND,
              label=u'\u53cd\u5ba1\u6838\u501f\u8c03\u5355',
              name=u'cbAntiauditPeerLend', parent=self, pos=wx.Point(744, 240),
              size=wx.Size(120, 16), style=0)
        self.cbAntiauditPeerLend.SetValue(False)

        self.staticBox4 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX4,
              label=u'\u76f4\u9001\u5355\u6743\u9650', name='staticBox4',
              parent=self, pos=wx.Point(24, 336), size=wx.Size(864, 56),
              style=0)

        self.cbCreateVoucher = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATEVOUCHER,
              label=u'\u521b\u5efa\u4f1a\u6b3e\u5355', name=u'cbCreateVoucher',
              parent=self, pos=wx.Point(48, 304), size=wx.Size(105, 16),
              style=0)
        self.cbCreateVoucher.SetValue(False)

        self.cbEditVoucher = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITVOUCHER,
              label=u'\u7f16\u8f91\u4f1a\u6b3e\u5355', name=u'cbEditVoucher',
              parent=self, pos=wx.Point(176, 304), size=wx.Size(105, 16),
              style=0)
        self.cbEditVoucher.SetValue(True)

        self.cbEditOtherVoucher = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITOTHERVOUCHER,
              label=u'\u7f16\u8f91\u4ed6\u4eba\u4f1a\u6b3e\u5355',
              name=u'cbEditOtherVoucher', parent=self, pos=wx.Point(304, 304),
              size=wx.Size(144, 16), style=0)
        self.cbEditOtherVoucher.SetValue(False)

        self.cbDelVoucher = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELVOUCHER,
              label=u'\u5220\u9664\u4f1a\u6b3e\u5355', name=u'cbDelVoucher',
              parent=self, pos=wx.Point(472, 304), size=wx.Size(105, 16),
              style=0)
        self.cbDelVoucher.SetValue(True)

        self.cbAuditVoucher = wx.CheckBox(id=wxID_DLGPRIVILEGESCBAUDITVOUCHER,
              label=u'\u5ba1\u6838\u4f1a\u6b3e\u5355', name=u'cbAuditVoucher',
              parent=self, pos=wx.Point(608, 304), size=wx.Size(105, 16),
              style=0)
        self.cbAuditVoucher.SetValue(True)

        self.cbAntiAuditVoucher = wx.CheckBox(id=wxID_DLGPRIVILEGESCBANTIAUDITVOUCHER,
              label=u'\u53cd\u5ba1\u6838\u4f1a\u6b3e\u5355',
              name=u'cbAntiAuditVoucher', parent=self, pos=wx.Point(744, 304),
              size=wx.Size(120, 16), style=0)
        self.cbAntiAuditVoucher.SetValue(True)

        self.staticBox5 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX5,
              label=u'\u8d22\u52a1\u6743\u9650', name='staticBox5', parent=self,
              pos=wx.Point(24, 272), size=wx.Size(864, 56), style=0)

        self.cbCreateDelivery = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATEDELIVERY,
              label=u'\u521b\u5efa\u76f4\u9001\u5355', name=u'cbCreateDelivery',
              parent=self, pos=wx.Point(48, 368), size=wx.Size(105, 16),
              style=0)
        self.cbCreateDelivery.SetValue(True)

        self.cbEditDelivery = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITDELIVERY,
              label=u'\u7f16\u8f91\u76f4\u9001\u5355', name=u'cbEditDelivery',
              parent=self, pos=wx.Point(176, 368), size=wx.Size(105, 16),
              style=0)
        self.cbEditDelivery.SetValue(False)

        self.cbEditOtherDelivery = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITOTHERDELIVERY,
              label=u'\u7f16\u8f91\u4ed6\u4eba\u76f4\u9001\u5355',
              name=u'cbEditOtherDelivery', parent=self, pos=wx.Point(304, 368),
              size=wx.Size(144, 16), style=0)
        self.cbEditOtherDelivery.SetValue(True)

        self.cbDelDelivery = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELDELIVERY,
              label=u'\u5220\u9664\u76f4\u9001\u5355', name=u'cbDelDelivery',
              parent=self, pos=wx.Point(472, 368), size=wx.Size(105, 16),
              style=0)
        self.cbDelDelivery.SetValue(False)

        self.cbAuditDelivery = wx.CheckBox(id=wxID_DLGPRIVILEGESCBAUDITDELIVERY,
              label=u'\u5ba1\u6838\u76f4\u9001\u5355', name=u'cbAuditDelivery',
              parent=self, pos=wx.Point(608, 368), size=wx.Size(105, 16),
              style=0)
        self.cbAuditDelivery.SetValue(False)

        self.cbAntiAuditDelivery = wx.CheckBox(id=wxID_DLGPRIVILEGESCBANTIAUDITDELIVERY,
              label=u'\u53cd\u5ba1\u6838\u76f4\u9001\u5355',
              name=u'cbAntiAuditDelivery', parent=self, pos=wx.Point(744, 368),
              size=wx.Size(120, 16), style=0)
        self.cbAntiAuditDelivery.SetValue(False)

        self.staticBox6 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX6,
              label=u'\u57fa\u672c\u4fe1\u606f\u6743\u9650', name='staticBox6',
              parent=self, pos=wx.Point(24, 400), size=wx.Size(864, 88),
              style=0)

        self.cbCreatePeer = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATEPEER,
              label=u'\u521b\u5efa\u540c\u884c', name=u'cbCreatePeer',
              parent=self, pos=wx.Point(48, 456), size=wx.Size(105, 16),
              style=0)
        self.cbCreatePeer.SetValue(False)

        self.cbEditPeer = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITPEER,
              label=u'\u7f16\u8f91\u540c\u884c', name=u'cbEditPeer',
              parent=self, pos=wx.Point(176, 456), size=wx.Size(105, 16),
              style=0)
        self.cbEditPeer.SetValue(True)

        self.cbDelPeer = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELPEER,
              label=u'\u5220\u9664\u540c\u884c', name=u'cbDelPeer', parent=self,
              pos=wx.Point(304, 456), size=wx.Size(144, 16), style=0)
        self.cbDelPeer.SetValue(False)

        self.cbCreateProduct = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATEPRODUCT,
              label=u'\u521b\u5efa\u5546\u54c1', name=u'cbCreateProduct',
              parent=self, pos=wx.Point(472, 456), size=wx.Size(105, 16),
              style=0)
        self.cbCreateProduct.SetValue(True)

        self.cbEditProduct = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITPRODUCT,
              label=u'\u7f16\u8f91\u5546\u54c1', name=u'cbEditProduct',
              parent=self, pos=wx.Point(608, 456), size=wx.Size(105, 16),
              style=0)
        self.cbEditProduct.SetValue(True)

        self.cbDelProduct = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELPRODUCT,
              label=u'\u5220\u9664\u5546\u54c1', name=u'cbDelProduct',
              parent=self, pos=wx.Point(744, 456), size=wx.Size(120, 16),
              style=0)
        self.cbDelProduct.SetValue(True)

        self.cbSetting = wx.CheckBox(id=wxID_DLGPRIVILEGESCBSETTING,
              label=u'\u7ba1\u7406\u914d\u7f6e', name=u'cbSetting', parent=self,
              pos=wx.Point(48, 520), size=wx.Size(105, 16), style=0)
        self.cbSetting.SetValue(False)

        self.cbStaff = wx.CheckBox(id=wxID_DLGPRIVILEGESCBSTAFF,
              label=u'\u7ba1\u7406\u5458\u5de5', name=u'cbStaff', parent=self,
              pos=wx.Point(176, 520), size=wx.Size(105, 16), style=0)
        self.cbStaff.SetValue(True)

        self.cbPrivilege = wx.CheckBox(id=wxID_DLGPRIVILEGESCBPRIVILEGE,
              label=u'\u7ba1\u7406\u5458\u5de5\u6743\u9650',
              name=u'cbPrivilege', parent=self, pos=wx.Point(304, 520),
              size=wx.Size(144, 16), style=0)
        self.cbPrivilege.SetValue(False)

        self.cbExpense = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEXPENSE,
              label=u'\u7ba1\u7406\u8d39\u7528\u652f\u51fa', name=u'cbExpense',
              parent=self, pos=wx.Point(472, 520), size=wx.Size(120, 16),
              style=0)
        self.cbExpense.SetValue(False)

        self.cbReport = wx.CheckBox(id=wxID_DLGPRIVILEGESCBREPORT,
              label=u'\u67e5\u770b\u62a5\u8868', name=u'cbReport', parent=self,
              pos=wx.Point(608, 520), size=wx.Size(105, 16), style=0)
        self.cbReport.SetValue(False)

        self.cbAccount = wx.CheckBox(id=wxID_DLGPRIVILEGESCBACCOUNT,
              label=u'\u7f16\u8f91\u8d44\u91d1\u8d26\u6237', name=u'cbAccount',
              parent=self, pos=wx.Point(744, 520), size=wx.Size(120, 16),
              style=0)
        self.cbAccount.SetValue(False)

        self.cbCreateCustomer = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATECUSTOMER,
              label=u'\u521b\u5efa\u5ba2\u6237', name=u'cbCreateCustomer',
              parent=self, pos=wx.Point(48, 432), size=wx.Size(105, 16),
              style=0)
        self.cbCreateCustomer.SetValue(False)

        self.cbEditCustomer = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITCUSTOMER,
              label=u'\u7f16\u8f91\u5ba2\u6237', name=u'cbEditCustomer',
              parent=self, pos=wx.Point(176, 432), size=wx.Size(105, 16),
              style=0)
        self.cbEditCustomer.SetValue(True)

        self.cbDelCustomer = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELCUSTOMER,
              label=u'\u5220\u9664\u5ba2\u6237', name=u'cbDelCustomer',
              parent=self, pos=wx.Point(304, 432), size=wx.Size(144, 16),
              style=0)
        self.cbDelCustomer.SetValue(False)

        self.cbCreateSupplier = wx.CheckBox(id=wxID_DLGPRIVILEGESCBCREATESUPPLIER,
              label=u'\u521b\u5efa\u4f9b\u5e94\u5546', name=u'cbCreateSupplier',
              parent=self, pos=wx.Point(472, 432), size=wx.Size(105, 16),
              style=0)
        self.cbCreateSupplier.SetValue(True)

        self.cbEditSupplier = wx.CheckBox(id=wxID_DLGPRIVILEGESCBEDITSUPPLIER,
              label=u'\u7f16\u8f91\u4f9b\u5e94\u5546', name=u'cbEditSupplier',
              parent=self, pos=wx.Point(608, 432), size=wx.Size(105, 16),
              style=0)
        self.cbEditSupplier.SetValue(True)

        self.cbDelSupplier = wx.CheckBox(id=wxID_DLGPRIVILEGESCBDELSUPPLIER,
              label=u'\u5220\u9664\u4f9b\u5e94\u5546', name=u'cbDelSupplier',
              parent=self, pos=wx.Point(744, 432), size=wx.Size(120, 16),
              style=0)
        self.cbDelSupplier.SetValue(True)

        self.staticBox7 = wx.StaticBox(id=wxID_DLGPRIVILEGESSTATICBOX7,
              label=u'\u914d\u7f6e\u6743\u9650', name='staticBox7', parent=self,
              pos=wx.Point(24, 496), size=wx.Size(864, 56), style=0)

        self.btnNewGroup = wx.Button(id=wxID_DLGPRIVILEGESBTNNEWGROUP,
              label=u'\u6dfb\u52a0\u5458\u5de5\u7ec4', name=u'btnNewGroup',
              parent=self, pos=wx.Point(312, 24), size=wx.Size(93, 26),
              style=0)
        self.btnNewGroup.Bind(wx.EVT_BUTTON, self.OnBtnNewGroupButton,
              id=wxID_DLGPRIVILEGESBTNNEWGROUP)

        self.btnCheckAll = wx.Button(id=wxID_DLGPRIVILEGESBTNCHECKALL,
              label=u'\u5168\u52fe/\u5168\u5426', name=u'btnCheckAll',
              parent=self, pos=wx.Point(768, 32), size=wx.Size(93, 26),
              style=0)
        self.btnCheckAll.Bind(wx.EVT_BUTTON, self.OnBtnCheckAllButton,
              id=wxID_DLGPRIVILEGESBTNCHECKALL)

    def __init__(self, parent):
        self._init_ctrls(parent)
        
        self.myInit()
        
    def myInit(self):
        self.m_dict = {
            'create_sale':self.cbCreateSale,
            'edit_sale':self.cbEditSale,
            'del_sale':self.cbDelSale,
            'edit_other_sale':self.cbEditOtherSale,
            'audit_sale':self.cbAuditSale,
            'antiaudit_sale':self.cbAntiAuditSale,
            'create_pur':self.cbCreatePur,
            'edit_pur':self.cbEditPur,
            'del_pur':self.cbDelPur,
            'edit_other_pur':self.cbEditOtherPur,
            'audit_pur':self.cbAuditPur,
            'antiaudit_pur':self.cbAntiAuditPur,
            'create_voucher':self.cbCreateVoucher,
            'edit_voucher':self.cbEditVoucher,
            'del_voucher':self.cbDelVoucher,
            'edit_other_voucher':self.cbEditOtherVoucher,
            'audit_voucher':self.cbAuditVoucher,
            'antiaudit_voucher':self.cbAntiAuditVoucher,
            'create_peerlend':self.cbCreatePeerLend,
            'edit_peerlend':self.cbEditPeerLend,
            'del_peerlend':self.cbDelPeerLend,
            'edit_other_peerlend':self.cbEditOtherPeerLend,
            'audit_peerlend':self.cbAuditPeerLend,
            'antiaudit_peerlend':self.cbAntiauditPeerLend,
            'create_delivery':self.cbCreateDelivery,
            'edit_delivery':self.cbEditDelivery,
            'del_delivery':self.cbDelDelivery,
            'edit_other_delivery':self.cbEditOtherDelivery,
            'audit_delivery':self.cbAuditDelivery,
            'antiaudit_delivery':self.cbAntiAuditDelivery,
            'read_report':self.cbReport,
            'edit_privileges':self.cbPrivilege,
            'edit_expense':self.cbExpense,
            'edit_settings':self.cbSetting,
            'edit_staff':self.cbStaff,
            'edit_account':self.cbAccount,
            'create_customer':self.cbCreateCustomer,
            'edit_customer':self.cbEditCustomer,
            'del_customer':self.cbDelCustomer,
            'create_peer':self.cbCreatePeer,
            'edit_peer':self.cbEditPeer,
            'del_peer':self.cbDelPeer,
            'create_supplier':self.cbCreateSupplier,
            'edit_supplier':self.cbEditSupplier,
            'del_supplier':self.cbDelSupplier,
            'create_product':self.cbCreateProduct,
            'edit_product':self.cbEditProduct,
            'del_product':self.cbDelProduct,
        }
        
        self.m_dict_cb = {val:key for key,val in self.m_dict.items()}
        
        for privilege,cb in self.m_dict.items():
            cb.SetName(privilege)
            cb.Bind(wx.EVT_CHECKBOX, self.OnCbCreateSaleCheckbox)
            cb.SetValue(0)
        
        self.comboGroup = MyComboBoxDecorator(self.cbGroup, 
                                            CDataStaffGroup,
                                            CDataStaffGroup.iName)
        self.comboGroup.refresh()
        
        groupid = config.Cfg.getCurUser().getValue(CDataStaff.COL_GROUPID)
        group = CDataStaffGroup.findObj(groupid)
        self.comboGroup.SetValue(group.getValue(group.iName))
        
        self.refreshCheck()
        
    def OnCbCreateSaleCheckbox(self, event):
        cb = event.GetEventObject()
        
        group = self.comboGroup.getSelectObj()
        
        if not CDataPrivilege.set(cb.GetName(), cb.GetValue(), group.getValue(group.iId)):
            dlg = wx.MessageDialog(self, u'设置失败', u'提示',
                                    wx.OK|wx.ICON_ERROR)
            dlg.ShowModal()

    def OnBtnNewGroupButton(self, event):
        dlg = wx.TextEntryDialog(
                self, u'输入员工组名称：',u'新建员工组', '')
        if dlg.ShowModal() == wx.ID_CANCEL:
            return
        
        CDataStaffGroup.add(dlg.GetValue())
        
        self.comboGroup.refresh()
        self.comboGroup.SetValue(dlg.GetValue())
        
        self.ClearChecked()
        

    def OnBtnCheckAllButton(self, event):
        
        self.m_check = False
        for cb in self.m_dict.values():
            if not cb.GetValue():
                self.m_check = True
                
        for cb in self.m_dict.values():
            cb.SetValue(self.m_check)
        
        group = self.comboGroup.getSelectObj()
        CDataPrivilege.resetGroup(group.getValue(group.iId),self.m_check)

    def ClearChecked(self):
        for privilege,cb in self.m_dict.items():
            cb.SetValue(0)
    
    def refreshCheck(self):
        group = self.comboGroup.getSelectObj()
        
        self.ClearChecked()
        for op in CDataPrivilege.get(group.getValue(group.iId)):
            self.m_dict[op[0]].SetValue(1)
            
    def OnCbGroupCombobox(self, event):
        self.refreshCheck()
        
